from django.conf.urls.defaults import *
from polls.models import Poll

info_dict = {
    "queryset": Poll.objects.all()
}

urlpatterns = patterns(
    ""
    # index list
    , (r"^$", "django.views.generic.list_detail.object_list", info_dict)
    # voting form
    , (r"^(?P<object_id>\d+)/$", "django.views.generic.list_detail.object_detail", info_dict)
    # result of poll voting
    , url(r"^(?P<object_id>\d+)/results/$", "django.views.generic.list_detail.object_detail", dict(info_dict, template_name = "polls/results.html"), "poll_results")
    # vote action
    , (r"^(?P<id>\d+)/vote/$", "polls.views.vote")
    , (r"^secured/$", "polls.views.secured")
)
